{{define "default/index.html"}}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{.title}}</title>
</head>

<body>
    {{$t := .data}}
    <h1>default-index</h1>
    {{$t.age}}
    <!-- 条件判断 -->
    {{if ge $t.age 18}}
    <h1>成年</h1>

    {{else}}
    <h1>未成年</h1>
    {{end}}

    {{template "default/news.html" . }}

    <form action="/news" method="post" enctype="multipart/form-data">
        <input type="text" name="name" placeholder="请输入名字">
        <input type="file" name="file">
        <button type="submit">提交</button>
    </form>

</body>

</html>
{{end}}